#include "gtest/gtest.h"
#include "List02.hpp"

TEST(resizeTest, bounds)
{
	int arr[] = {1, 2, 3, 4, 5, 6, 7, 8, 9 };
	List<int> lst(arr, arr + sizeof(arr) / sizeof(int));

	lst.resize(5);
	EXPECT_EQ(lst.size(), 5u);
	EXPECT_EQ(*--lst.end(), 5);

	lst.resize(8, 100);
	EXPECT_EQ(lst.size(), 8u);
	EXPECT_EQ(*--lst.end(), 100);

	lst.resize(10);
	EXPECT_EQ(lst.size(), 10u);
	EXPECT_EQ(*--lst.end(), 0);
}
